import { colorKey } from "../constant/color.const"
import unitTypeEnum from "../enum/unitType.enum"
import ObservableObject from "../observer/observable.object"
import playerConst from "../constant/player.const"
export default class PlayerOptions extends ObservableObject {
  presented_by: boolean
  highlight_reel: boolean
  floor_plan: boolean
  tour_buttons: boolean
  labels: boolean
  labels_dh: boolean
  floor_select: boolean
  measurements: boolean
  measurements_saved: boolean
  dollhouse: boolean
  contact_email: boolean
  address: boolean
  contact_name: boolean
  model_summary: boolean
  contact_phone: boolean
  model_name: boolean
  external_url: boolean
  unit_type: string
  background_color: string
  fast_transitions: boolean
  transition_speed: number
  transition_time: number
  pan_speed: number
  dollhouse_pan_speed: number
  zoom_duration: number
  pan_angle: number
  pan_direction: number
  constructor(e: Partial<PlayerOptions>) {
    super()
    this.presented_by = !1
    this.highlight_reel = !0
    this.floor_plan = !0
    this.tour_buttons = !0
    this.labels = !0
    this.labels_dh = !0
    this.floor_select = !0
    this.measurements = !0
    this.measurements_saved = !0
    this.dollhouse = !0
    this.contact_email = !1
    this.address = !1
    this.contact_name = !1
    this.model_summary = !1
    this.contact_phone = !1
    this.model_name = !1
    this.external_url = !1
    this.unit_type = unitTypeEnum.IMPERIAL
    this.background_color = colorKey.default
    this.fast_transitions = playerConst.fast_transitions
    this.transition_speed = playerConst.transition_speed
    this.transition_time = playerConst.transition_time
    this.pan_speed = playerConst.pan_speed
    this.dollhouse_pan_speed = playerConst.dollhouse_pan_speed
    this.zoom_duration = playerConst.zoom_duration
    this.pan_angle = playerConst.pan_angle
    this.pan_direction = playerConst.pan_direction
    e && this.copy(e)
  }
  copy(e: Partial<PlayerOptions>) {
    this.presented_by = !!e.presented_by
    this.highlight_reel = !!e.highlight_reel
    this.floor_plan = !!e.floor_plan
    this.tour_buttons = !!e.tour_buttons
    this.labels = !!e.labels
    this.dollhouse = !!e.dollhouse
    this.fast_transitions = !!e.fast_transitions
    this.contact_email = !!e.contact_email
    this.address = !!e.address
    this.contact_name = !!e.contact_name
    this.model_summary = !!e.model_summary
    this.contact_phone = !!e.contact_phone
    this.model_name = !!e.model_name
    this.external_url = !!e.external_url
    void 0 !== e.measurements && (this.measurements = e.measurements)
    void 0 !== e.labels_dh && (this.labels_dh = e.labels_dh)
    void 0 !== e.floor_select && (this.floor_select = e.floor_select)
    void 0 !== e.measurements_saved && (this.measurements_saved = e.measurements_saved)
    void 0 !== e.unit_type && (this.unit_type = e.unit_type)
    void 0 !== e.background_color && void 0 !== colorKey[e.background_color] && (this.background_color = e.background_color)
    void 0 !== e.transition_speed && (this.transition_speed = e.transition_speed)
    void 0 !== e.transition_time && (this.transition_time = e.transition_time)
    void 0 !== e.pan_speed && (this.pan_speed = e.pan_speed)
    void 0 !== e.dollhouse_pan_speed && (this.dollhouse_pan_speed = e.dollhouse_pan_speed)
    void 0 !== e.zoom_duration && (this.zoom_duration = e.zoom_duration)
    void 0 !== e.pan_angle && (this.pan_angle = e.pan_angle)
    void 0 !== e.pan_direction && (this.pan_direction = e.pan_direction)
  }
}
